package com.itcast.tanhua.dubbo.server.api;

import com.itcast.tanhua.dubbo.server.domain.Comment;
import com.itcast.tanhua.dubbo.server.domain.Publish;
import com.itcast.tanhua.dubbo.server.vo.PageInfo;

import java.util.List;

/**
 * @PachageName: com.itcast.tanhua.dubbo.server.api
 * @ClassName:
 * @Description: TODO
 * @Author: Hushi
 * @DateTime: 2021/2/1711:24
 * @Version 1.0
 */
public interface QuanZiApi {
    /**
     * 发布动态
     * @param publish 发布表对象
     * @return 返回布尔值
     */
    boolean savePublish(Publish publish);

    /**
     * 查询好友动态
     * @param userId 用户ID
     * @param page 第几页
     * @param pageSize 每页多少条数据
     * @return 分页pageInfo
     */
    PageInfo<Publish> queryPublishList(Long userId,Integer page,Integer pageSize);

    /**
     * 点赞
     *
     * @param userId
     * @param publishId
     * @return
     */
    boolean saveLikeComment(Long userId, String publishId);

    /**
     * 取消点赞、喜欢等
     *
     * @param userId
     * @param publishId
     * @return
     */
    boolean removeComment(Long userId, String publishId, Integer commentType);

    /**
     * 喜欢
     *
     * @param userId
     * @param publishId
     * @return
     */
    boolean saveLoveComment(Long userId, String publishId);

    /**
     * 保存评论
     *
     * @param userId
     * @param publishId
     * @param type
     * @param content
     * @return
     */
    boolean saveComment(Long userId, String publishId, Integer type, String content);

    /**
     * 查询评论数
     *
     * @param publishId
     * @param type
     * @return
     */
    Long queryCommentCount(String publishId, Integer type);

    /**
     * 根据id查询动态(单条动态)
     *
     * @param id
     * @return
     */
    Publish queryPublishById(String id);

    /**
     * 查询评论
     *
     * @return
     */
    PageInfo<Comment> queryCommentList(String publishId, Integer page, Integer pageSize);

    /**
     * 查询用户的评论数据
     *
     * @return
     */
    PageInfo<Comment> queryCommentListByUser(Long userId, Integer type, Integer page, Integer pageSize);

    /**
     * 根据pid批量查询数据
     * @param pidList
     * @return
     */
    List<Publish> queryPublishByPids(List<Long> pidList);

    /**
     * 查询相册表
     *
     * @param userId
     * @param page
     * @param pageSize
     * @return
     */
    PageInfo<Publish> queryAlbumList(Long userId, Integer page, Integer pageSize);
}
